import request from '@/config/axios'

export interface ProcessCriterionVO {
  id: number
  name: string
  processCriterionInfo: string
  processCriterionFile: number
  status: number
  createTime: Date
}

// 查询列表
export const getProcessCriterionPage = (params: PageParam) => {
  return request.get({ url: '/processCriterion/page', params })
}

// 查询详情
export const getProcessCriterion = (id: number) => {
  return request.get({ url: '/processCriterion/get?id=' + id })
}

/**
 * 保存
 * @param params
 */
export const save = async (params: PageParam) => {
  return await request.post({ url: '/processCriterion/save', data: params })
}

// 删除
export const deleteProcessCriterion = (id: number) => {
  return request.delete({ url: '/processCriterion/delete?id=' + id })
}

// 状态修改
export const updateUserStatus = (id: number, status: number) => {
  const data = {
    id,
    status
  }
  return request.put({ url: '/processCriterion/update-status', data: data })
}

// 导出
export const exportProcessCriterion = async (params) => {
  return await request.download({ url: '/processCriterion/export', params })
}